﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<%@ include file="/common/meta.jsp"%>
		<title>MCCMS</title>
		<link href="${ctx}/js/validate/jquery.validate.css" type="text/css" rel="stylesheet" />
		<script src="${ctx}/js/validate/jquery.validate.js" type="text/javascript"></script>
		<script src="${ctx}/js/validate/messages_cn.js" type="text/javascript"></script>
		<link href="${ctx}/image/login5/style.css" rel="stylesheet" type="text/css" />
		<script src="${ctx}/image/login5/style.js" type="text/javascript"></script>
		<script type="text/javascript">
  			$(document).ready(function(){
				$("#loginForm").validate({
					 rules: { 
					 	j_username:
						{
							required: true
						},
						j_password:
						{
							required: true
						},
					 	vercode: 
					 	{ 
					 		required: true, 
		        			remote: "checkCodeAction!checkCode.action?math="+Math.random()
					 	}
					 },
					 messages: {
					 	vercode: {
							remote: "校验码错误!"
						}
					 },
					 success: function(label) {
						label.html("&nbsp;").addClass("checked");
			         }
				});
				
				$("#AuthImg").click(function(){
					var timenow = new Date().getTime();
  					this.src="${ctx}/AuthImg?d="+timenow;
				});
				
 			});
  		</script>
	</head>
	<body>
		<center>
		<div id="body2">
        <div id="content">
        	<div id="login_error">
	                    <%
			            if (session.getAttribute(AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) != null) {
				        %>
				        <span style="color:red;font-size:12px;">${sessionScope['SPRING_SECURITY_LAST_EXCEPTION'].message}</span>
				        <%
				            }
				        %>
	             </div>
        
            <form id="loginForm" name="loginForm" action="${ctx}/j_spring_security_check" method="post">
               
                <!--用户名(帐号)-->
                <div id="username">
                                     用&nbsp;&nbsp;户:
                    <input value="" type="text" name="j_username" id="j_username" maxlength="20"/>
                </div>
                
                <!--密码-->
                <div id="password">
					密&nbsp;&nbsp;码:
					<input value="" type="password" name="j_password" id="j_password" maxlength="20"/>
                </div>
                
                <!--验证码-->
                <div id="checkCode">
                	校验码:
                    <input type="text" name="vercode" id="vercode"/>
                    <img id="AuthImg" name="AuthImg" src="${ctx}/AuthImg" alt="换一个"/>
                </div>
                
                    
                <!--登陆按钮-->
                <div id="loginButton"><input type="submit" value=" 登 录 " /></div>
                
                <!--重置按钮-->
                <div id="resetButton">
                    <input type="reset" value=" 重 置 " />
                </div>
                <div id="copyright">
                	版权所有 2012-2013
                	广州德诚通信设备有限公司
                	All Rights Reserved.
                </div>
            </form>
        </div>
        </div>
        </center>
	</body>
</html>

